﻿<!doctype html>
<html>
	<head>
	<meta name="apple-mobile-web-app-capable" content="yes">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>{$isview?'查看':'审核'}任务[{$item['id']?$item['id']:''}]</title>
	<link rel="stylesheet" href="/static/home/mobile/css/bootstrap.css">
	<link href="/static/home/mobile/css/reset_5.css" rel="stylesheet" type="text/css" />
	<link href="/static/home/mobile/css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="/static/home/mobile/css/font-awesome.min.css">
    <link href="/static/home/mobile/css/lightbox.min.css" rel="stylesheet" type="text/css" />
	<link href="/static/home/mobile/css/new_style.css" rel="stylesheet" type="text/css" />
    <link href="/static/home/mobile/css/swiper.min.css" type="text/css" rel="stylesheet">
	<link href="/static/home/mobile/css/new_page.css" rel="stylesheet" type="text/css" />
    <link href="/static/home/mobile/css/new_style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/static/plugins/dialog/css/dialog.css" />
    <style type="text/css">
        .task-list-remain-num span {
            width: 33.33%;
            float: left;
            text-align: center;
        }
        .paging {
            padding: 30px 0;
        }
        .dialog {
          position: fixed;
          left: 0;
          top: 0;
          z-index: 10001;
          width: 100%;
          height: 100%;
        }
        .dialog-content {
            width: 70%;
        }
        .dialog-overlay {
          position: absolute;
          top: 0;
          left: 0;
          z-index: 10002;
          width: 100%;
          height: 100%;
          background-color: rgba(0, 0, 0, 0.5); 
        }
		body{background:#111;color:#e2e2e2;}
		.pr-info .info .time{color:#999;}
		.main.fixed-padding{background-color:#111;}
		.pr-info{background:#222;}
    </style>
    </head>
    <body data-offset="50" id="htmlBody">
    <header class="site-header header-fixed">
        <input type="hidden" id="taskId">
        <a onclick="history.back()" class="back"></a>
        <div class="tit-name" id="title_txt">{$isview?'查看':'审核'}任务[{$item['id']?$item['id']:''}]</div>
    </header>
    <div class="main fixed-padding">
        <div class="pr-info borm cl" style=" margin-bottom:10px;">
            <div class="pic type-txuser">
                <a href="#">
                	{if $item['avatar'] !=''}
                		<img  src="{$item['avatar']}?imageMogr2/auto-orient/thumbnail/!20p/blur/1x0/quality/10|imageslim" id="task_account_img">
                	{else /}
                		<img  src="/static/home/mobile/picture/pic2.png" id="task_account_img">
                	{/if}
                </a>
            </div>
            <div class="info">
                <div class="bt"><i class="bianhao">编号：</i><span id="task_id">{$item['id']?$item['id']:''}</span></div>
                <!--<div class="bt"><i class="fabu">发布者：</i><span id="task_account_name">{$item['username']?$item['username']:''}</span><i class="dengji">V{$item['level']?$item['level']:''}</i></div>-->
               <div class="bt"><i class="fabu">任务名称：</i><span id="task_account_name">{$item['title']?$item['title']:''}</span></div>
              <!-- 
              <div class="persent-box">
                    <div class="persent-all"><span class="persent-bi" style="width: {$item['percent']?$item['percent']:0}%;"></span></div><span class="num">{$item['percent']?$item['percent']:0}%</span>
              </div> 
              -->
                <div class="time">结束：<span id="task_endTime">{$item['end_time']?$item['end_time']:''}</span>剩余：<span id="task_remain">{$item['ticket_num']-$item['join_num']}</span>份</div>
                <div class="time" style="" id="div_task_stateNum">待审核：<span id="task_stateNum">{$item['audit_num']}</span>&nbsp;&nbsp;&nbsp;&nbsp;已抢单：<span id="task_allNum">{$item['join_num']}</span></div>
            </div>
        </div>

        <div class="pr-info borm cl" style=" margin-bottom:10px;">
            <div class="pic type-txuser">
                <a href="#"><img onerror="this.src='/static/home/mobile/picture/pic2.png'" src="{:to_media($joinMember['avatar']?$joinMember['avatar']:'')}" id="task_account_img"></a>
            </div>
            <div class="info">
                <div class="bt"><i class="bianhao">抢单用户ID：</i><span id="task_id">{$joinMember['uid']?$joinMember['uid']:''}</span></div>
                <!--<div class="bt"><i class="fabu">抢单用户：</i><span id="task_account_name">{$joinMember['username']?$joinMember['username']:''}</span><i class="dengji">V{$joinMember['level']?$joinMember['level']:''}</i></div>-->
               <div class="bt"><i class="fabu">抢单用户：</i><span id="task_account_name">{$joinMember['nickname']?$joinMember['nickname']:''}</span></div>
               <div class="bt"><i class="fabu">提交时间：</i><span id="task_account_name">{$joinInfo['update_time']?$joinInfo['update_time']:''}</span></div>
            </div>
        </div>

        {if !empty($joinInfo['thumbs'])}
        <div class="fujian cl">
            <p class="tit">上传验证图</p>
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    {volist name="joinInfo['thumbs']" id="thumb"}
                    <div class="swiper-slide">
                        <a data-lightbox="thumbs-set" href="{$thumb}"><img src="{$thumb}"></a></div>
                    {/volist}
                </div>
            </div>
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>
        </div>
        {/if}

        {if !empty($joinInfo['check_text_content']) || !empty($joinInfo['check_text_content2'])}
        <p class="tit">文字验证</p>
            <p id="task_description" style="width:98%">
                {:nl2br($item['check_text_content'])}
            </p>
        {if !empty($joinInfo['check_text_content'])}
        <div class="pr-xiangqing">
            
            <p class="tit">用户提交1</p>
            
            <p id="task_description" style="width:98%">
                {:nl2br($joinInfo['check_text_content'])}
            </p>
           </div>
        {/if}
        {if !empty($joinInfo['check_text_content2'])}
        <div class="pr-xiangqing">
            
            <p class="tit">用户提交2</p>
            
            <p id="task_description" style="width:98%">
                {:nl2br($joinInfo['check_text_content2'])}
            </p>
           </div>
        {/if}
        
        {/if}

        {if $joinInfo['status'] == 1}
        <div class="member-btn">
            <input type="button" class="button1"  value="已接单待提交"  style="background: #308CFC;color: #ffffff;"/>
        </div>
        {/if}
        {if $joinInfo['status']  == 2}
        <div class="member-btn">
            <input type="button" class="button1" value="待 审 核" id="submit"  style="background: #308CFC;color: #ffffff;"/>
        </div>
        {/if}
        {if $joinInfo['status']  == 3}
        <div class="member-btn">
            <input type="button" class="button1" value="已 通 过"   style="background: #308CFC;color: #ffffff;"/>
        </div>
        {/if}
        {if $joinInfo['status']  == 4}
        <div class="member-btn">
            <input type="button" class="button1"  value="已 拒 绝"   style="background: #308CFC;color: #ffffff;"/>
        </div>
        {/if}

        <script src="/static/home/mobile/js/jquery-2.0.3.min.js"></script>
        <script type="text/javascript" src="/static/home/mobile/js/lightbox.min.js"></script>
        <script type="text/javascript" src="/static/home/mobile/js/swiper.min.js"></script>
        <script type="text/javascript">
            var swiper = new Swiper('.fujian .swiper-container', {
                nextButton: '.fujian .swiper-button-next',
                prevButton: '.fujian .swiper-button-prev',
                spaceBetween: 0,
                speed: 1000,
                autoplay: 3000
            });
        </script>
        <script type="text/javascript" src="/static/home/mobile/js/global.js"></script>
        <!-- 弹出层 -->
        <script src="/static/plugins/dialog/js/dialog.js"></script>
        <script type="text/javascript" src="/static/plugins/bootstrap/js/bootstrap.js"></script>
      <script type="text/javascript" src="/static/home/mobile/js/bootbox.min.js"></script>
      <script type="text/javascript">
          var $setting_top_fee = '10';
          var $setting_top_max_hour = '24';
    </script>
        <script type="text/javascript">
        var id = {$joinInfo['id']?$joinInfo['id']:''};
        $("#submit").click(function(){
          	$("#submit").css('display','none');
            $(document).dialog({
                type : 'confirm',
                closeBtnShow: true,
                titleText: '确认审核',
                content: '用户提交的内容是否符合任务需求吗？',
                buttonTextConfirm: '符合，通过',
                buttonTextCancel: '不符合，拒绝',
                onClickConfirmBtn: function(){
                    $loading = message('审核中','','loading');
                    $.post('/home/mytaskaudit/audit.html', { id: id }, function(res) {
                        message(res.message,res.redirect,res.type);
                        $loading.close();
                    });
                },
                onClickCancelBtn : function(){
                    //$loading = message('审核中','','loading');
                  //var id=$("input[name=joinid]").val();
                  console.log(id);
                  nopass(id);
                 /* $("#myform").css('display','block');
                    $.post('/home/mytaskaudit/nopass.html', { id: id }, function(res) {
                        message(res.message,res.redirect,res.type);
                        $loading.close();
                    });*/
                             
                            
                },
              onClickCloseBtn:function(){
               $("#submit").css('display','block'); 
              }
            });
        });
          $(".dialog-btn-close").click(function(){
          	$("#submit").css('display','block');
          })
        </script>
      <style>
      	#myform{
        	position:absolute;
          	top:300px;
          background-color:red;
          left:0;
          height:50px;
          width:100%;
          display:none;
        }
      </style>
      <div id='myform'>
        <div>
          <span>请输入不符合原因</span><input type='text' name="reason"/><input type='hidden' name='joinid' />
        </div>
        <div>
          <input type='submit' value="确认" onclick="refuse()" />
        </div>
      </div>
      <script>
      	function refuse(){
        	var reason = $("input[name=reason]").val();
          	var joinid = $("input[name=joinid]").val();
          if(reason == ''){
            return false;
          }
          $loading = message('审核中','','loading');
          	$.post('/home/mytaskaudit/nopass.html', { id: joinid,reason:reason }, function(res) {
                        message(res.message,res.redirect,res.type);
                        $loading.close();
                       
                    });
        }
        
 function nopass(id){
    var title_m="请在下方输入拒绝理由:失败24小时后返还名额，请尽量沟通后审核。通过率低的任务会影响赚客的报名意愿。恶意提交可以在审核不通过后到【任务记录】中举报";
    var posturl='/home/mytaskaudit/nopass.html';
    var json_data="";
    bootbox.prompt({
        size: "small",
        title: title_m,
        inputType: 'text',
     
        buttons: {
            confirm: {
                label: '确定',
                className: 'btn-success'
            },
            cancel: {
                label: '取消',
                className: 'btn-danger'
            }
        },
        callback: function (result) {
            if (result == null) {
                return;
            }
            if ($.trim(result) == "") {
                message('输入不能为空','','error');
                return;
            }
    		json_data={id: id, reason: result};
   
            $.post(posturl,json_data, function(res){
                if(res.type == "success"){
                    message(res.message,res.redirect,res.type);
                }else{
                    message(res.message,res.redirect,res.type);
                }
            });
        }
    });
}

      </script>
    </body>
</html>